﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;

namespace Riolinx.SocialConnekt.Community.WebParts
{
    public partial class ClaimUsersUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Guid siteID = SPContext.Current.Site.ID;
            Guid webId = SPContext.Current.Web.ID;

            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite site = new SPSite(siteID))
                {
                    using (SPWeb web = site.OpenWeb(webId))
                    {
                        
                        SPUserCollection colUsers = web.SiteUsers;
                        ClaimUsersGridView.DataSource = colUsers;
                        ClaimUsersGridView.DataBind();
                    }
                }
            });

            
            //foreach (SPUser user in SPContext.Current.Web.AllUsers)
            //{
            //    user.i
            //}
        }
    }
}
